package com.hunan.api.catv.entity.enums;

/**
 * 登录方式
 */
public enum LoginType {

    sms(1, "短信登录"),

    wechat(2, "微信登录"),

    apple(3, "苹果登录"),

    jiguang(4, "极光一键登录登录");

    private final Integer code;

    private final String msg;


    LoginType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static LoginType getResult(int code) {
        LoginType[] rcs = LoginType.values();
        for (LoginType rc : rcs) {
            if (rc.getCode() == code) {
                return rc;
            }
        }
        return null;
    }
}
